﻿using System.ComponentModel;
using System.Windows.Forms;

namespace Controls_Library
{
    /// <summary>
    /// Stylable button
    /// </summary>
    public partial class CustomButton : Button, IStylable
    {
        public const StyleEnum DefaultStyle = StyleEnum.Dark;

        public CustomButton()
        {
            InitializeComponent();
            Style = DefaultStyle;
            Invalidate();
        }

        private StyleEnum style;
        [Browsable(true), EditorBrowsable(EditorBrowsableState.Always)]
        [Category("Layout"), Description("Visual style of the button"), DefaultValue(StyleEnum.Dark)]
        public StyleEnum Style
        {
            get { return style; }

            set
            {
                style = value;
                ControlStyles.UpdateStyle(this, style);
                Invalidate();
            }
        }
    }
}
